﻿// <copyright file="ICacheWrapper.cs" company="Pelican Design &amp; Development">
//      Copyright (c) Pelican Design &amp; Development. All Rights Reserved.
// </copyright>
// <author id="5c2316d3-622a-4a8d-816d-5054a48f415f">Arseni Mourzenko</author>

namespace PelicanDD.Samples.CacheInSandbox
{
    using System;

    /// <summary>
    /// Represents an adapter for cache.
    /// </summary>
    public interface ICacheWrapper
    {
        /// <summary>
        /// Adds an item to the cache.
        /// </summary>
        /// <param name="key">The cache key used to reference the item.</param>
        /// <param name="value">The item to be added to cache.</param>
        /// <param name="relativeExpiration">The lifespan of the item in cache.</param>
        void Add(string key, object value, TimeSpan relativeExpiration);

        /// <summary>
        /// Retrieves an item from cache.
        /// </summary>
        /// <param name="key">The cache key used to reference the item.</param>
        /// <returns>The value from cache, or null if the value cannot be found.</returns>
        object Get(string key);
    }
}
